<style type="text/css" media="all">
@import "activity.css";.STYLE1 {
    font-family:Tahoma;
	font-size:16px;
	font-weight: bold;
	margin-top:15px;
	margin-bottom:15px;
}
.body{
background-color:#CCCCCC}
</style>
<div class="header">
<?php
     error_reporting(0);
	 include("../head.php");
?>
</div>
<div class="import1">
  <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="900" height="300">
    <param name="movie" value="../news/news.swf" />
    <param name="quality" value="high" />
    <embed src="../news/news.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="900" height="300"></embed>
  </object>
</div>
<?php
	session_start();
	include("../dbconnect.inc.php");
	$id = $_GET["category"];
	if(!is_numeric($id)&&$id!="") die("idwrong");
	if($id!="") {
		$res = mysql_query("select * from activitycategory where id={$id}");
		$row = mysql_fetch_array($res);
		$category_name = $row["category_name"];
	}else {
		$category_name="ALL ACTIVITY CATAGORY";
	}

?>
<div class="import2">
  <ul>
   <li style="margin-top:30px; margin-bottom:10px; font-size:24px"><a href="newslist.php"><strong><?php echo $category_name; ?></strong></a></li>
   <li style="margin-top:10px; margin-bottom:10px; font-size:20px">
   <?php
	$res = mysql_query("select * from activitycategory");
	while($row = mysql_fetch_array($res)) {
		$categorys[$row["id"]] = $row["category_name"];
		echo "<a href='activity.php?category={$row['id']}'>{$row['category_name']}</a> | ";	
	}
  ?>
   </li>
   <?php
	$p = $_GET["p"];
	if($p =="" ) $p=0;
	$start = $p*$PAGE_SIZE;
	$end = $PAGE_SIZE;
	if($id!="") {
		$sql = "select id,title from activity where category_id={$id} ";
		$sql .= "order by pubtime desc limit {$start},{$end}";
	}else {
		$sql = "select id,title from activity order by pubtime desc limit {$start},{$end}";
	}
	$res = mysql_query($sql);
	if($p==0) {
		$pagelink1 = "frontpage";
	}else {
		$pz = $p-1;
		$pagelink1 = "<a href='activity.php?category={$id}&p={$pz}'>frontpage</a>";
	}
	if(mysql_num_rows($res) == $PAGE_SIZE) {
		$pz=$p+1;
		$pagelink2 = "<a href='activity.php?category={$id}&p={$pz}'>nextpage</a>";	
	}else {
		$pagelink2 = "nextpage";	
	}
	
	while($row = mysql_fetch_array($res)) {
?>
    <li><a href="display.php?id=<?php echo $row['id']; ?>" ><?php echo $row['title']; ?></a></li>
	<li class="dotLine"></li>
    <?php
	}
?>
  </ul>
  <br /><?php echo $pagelink1."&nbsp;".$pagelink2; ?>
</div>
<div class="back">
  <p><a href="activity.php">back</a></p>
</div>
</body>
</html>